func go/types.assert

174 uses

	go/types (current package)
		alias.go#L88: 	assert(a.targs == nil)
		alias.go#L145: 	assert(rhs != nil)
		alias.go#L166: 	assert(len(targs) > 0)
		assignments.go#L31: 		assert(isTypes2)
		assignments.go#L137: 	assert(isConstType(x.typ))
		assignments.go#L305: 	assert(!(variadic && hasDots))
		builtins.go#L329: 			assert(!isTypeParam(typ))
		builtins.go#L449: 			assert(!isTypeParam(typ))
		builtins.go#L917: 	assert(x.mode != invalid)
		builtins.go#L1023: 		assert(!isUntyped(res))
		call.go#L36: 	assert(T != nil || ix != nil)
		call.go#L57: 		assert(len(targs) == len(xlist))
		call.go#L124: 	assert(got == want)
		call.go#L134: 	assert(check != nil)
		call.go#L135: 	assert(len(targs) == typ.TypeParams().Len())
		call.go#L150: 	assert(inst.TypeParams().Len() == 0) // signature is not generic anymore
		call.go#L152: 	assert(len(xlist) <= len(targs))
		call.go#L180: 			assert(x.mode == value)
		call.go#L272: 		assert(len(targs) == len(xlist))
		call.go#L363: 			assert(len(targsList) == len(xlistList))
		call.go#L369: 						assert(n < x.typ.(*Signature).TypeParams().Len())
		call.go#L566: 	assert(len(tparams) == len(targs))
		call.go#L602: 	assert(len(tparams) == len(targs))
		call.go#L690: 			assert(pname.pkg == check.pkg)
		call.go#L740: 				assert(exp.Val() != nil)
		check.go#L223: 	assert(!check.conf._EnableAlias)
		check.go#L233: 	assert(!check.conf._EnableAlias)
		check.go#L240: 	assert(!check.conf._EnableAlias)
		check.go#L556: 	assert(top <= len(check.delayed)) // stack must not have shrunk
		const.go#L23: 	assert(x.mode == constant_)
		const.go#L246: 	assert(v != nil)
		const.go#L255: 	assert(x.mode == constant_)
		context.go#L69: 	assert(ctxt != nil)
		context.go#L70: 	assert(orig != nil)
		context.go#L112: 	assert(inst != nil)
		decl.go#L98: 		assert(obj.Type() == nil)
		decl.go#L108: 		assert(obj.Type() != nil)
		decl.go#L160: 		assert(obj.Type() != nil)
		decl.go#L215: 	assert(obj.color() >= grey)
		decl.go#L433: 	assert(obj.typ == nil)
		decl.go#L479: 	assert(obj.typ == nil)
		decl.go#L504: 		assert(lhs == nil || lhs[0] == obj)
		decl.go#L542: 	assert(obj.typ == nil)
		decl.go#L597: 			assert(rhs != nil)
		decl.go#L636: 	assert(rhs != nil)
		decl.go#L680: 	assert(!check.inTParamList)
		decl.go#L757: 	assert(!check.objMap[obj].tdecl.Assign.IsValid()) // don't use TypeName.IsAlias (requires fully set up object)
		decl.go#L766: 		assert(base.TypeArgs().Len() == 0) // collectMethods should not be called on an instantiated type
		decl.go#L779: 			assert(m.name != "_")
		decl.go#L780: 			assert(mset.insert(m) == nil)
		decl.go#L788: 		assert(m.name != "_")
		decl.go#L809: 			assert(m.name != "_")
		decl.go#L810: 			assert(mset.insert(m) == nil)
		decl.go#L835: 	assert(obj.typ == nil)
		decl.go#L838: 	assert(check.iota == nil)
		decl.go#L941: 							assert(obj.typ != nil)
		errors.go#L18: func assert(p bool) {
		errors.go#L157: 	assert(code != 0)
		errors.go#L167: 			assert(check.iota != nil)
		errors.go#L286: 		assert(start <= pos && pos < end)
		errsupport.go#L56: 			assert(alt != sel) // otherwise there is no lookup error
		expr.go#L1276: 	assert(hint != nil)
		expr.go#L1325: 			assert(t.Len() != 1)
		gcsizes.go#L17: 		assert(result >= 1)
		gcsizes.go#L54: 		assert(!isTypeParam(T))
		gcsizes.go#L104: 		assert(isTyped(T))
		gcsizes.go#L157: 		assert(!isTypeParam(T))
		index.go#L368: 	assert(ok)
		infer.go#L42: 			assert(inferred == nil || len(inferred) == len(tparams) && !slices.Contains(inferred, nil))
		infer.go#L55: 	assert(n > 0 && len(targs) <= n)
		infer.go#L58: 	assert(params.Len() == len(args))
		infer.go#L359: 		assert(isTyped(d))
		infer.go#L375: 			assert(targ == nil || inferred[i] == targ)
		infer.go#L661: 			assert(n == 0)
		infer.go#L673: 			assert(debug && under(single.typ) == coreType(tpar))
		instantiate.go#L56: 	assert(len(targs) > 0)
		instantiate.go#L64: 		assert(len(tparams) > 0)
		instantiate.go#L104: 	assert(len(ctxts) > 0)
		instantiate.go#L137: 			assert(expanding == nil) // Alias instances cannot be reached from Named types
		instantiate.go#L156: 		assert(expanding == nil) // function instances cannot be reached from Named types
		labels.go#L61: 		assert(b.gotoTarget(name) == nil)
		lookup.go#L172: 						assert(f.typ != nil)
		lookup.go#L202: 					assert(m.typ != nil)
		lookup.go#L520: 	assert(isInterfacePtr(T))
		mono.go#L219: 			assert(typ.Obj().Pkg() == pkg)
		named.go#L187: 		assert(n.underlying == nil) // n is an unresolved instance
		named.go#L188: 		assert(n.loader == nil)     // instances are created by instantiation, in which case n.loader is nil
		named.go#L215: 		assert(n.underlying == nil)
		named.go#L216: 		assert(n.TypeArgs().Len() == 0) // instances are created by instantiation, in which case n.loader is nil
		named.go#L262: 	assert(len(targs) > 0)
		named.go#L285: 	assert(t.inst == nil || t.inst.orig.inst == nil)
		named.go#L330: 	assert(t.inst == nil)
		named.go#L365: 	assert(t.inst != nil) // only instances should have incomplete methods
		named.go#L372: 		assert(len(t.methods) == 0)
		named.go#L377: 		assert(t.inst.ctxt != nil) // we should still have a context remaining from the resolution phase
		named.go#L398: 	assert(origm != nil)
		named.go#L454: 	assert(t.inst == nil)
		named.go#L471: 	assert(samePkg(t.obj.pkg, m.pkg))
		named.go#L472: 	assert(t.inst == nil)
		named.go#L643: 	assert(n.inst.orig.underlying != nil)
		named.go#L654: 		assert(check != nil)
		named.go#L666: 	assert(n == n2)
		named.go#L686: 				assert(old.complete) // otherwise we are copying incomplete data
		object.go#L175: func (obj *object) setOrder(order uint32)     { assert(order > 0); obj.order_ = order }
		object.go#L176: func (obj *object) setColor(color color)      { assert(color != white); obj.color_ = color }
		object.go#L602: 		assert(Identical(typ, &emptyInterface))
		operand.go#L333: 		assert(Vp == nil)
		recording.go#L34: 	assert(x.expr != nil && typ != nil)
		recording.go#L60: 	assert(x != nil)
		recording.go#L61: 	assert(typ != nil)
		recording.go#L66: 		assert(val != nil)
		recording.go#L69: 		assert(!isValid(typ) || allBasic(typ, IsConstType))
		recording.go#L98: 	assert(x != nil)
		recording.go#L99: 	assert(len(a) == 2)
		recording.go#L104: 	assert(isTyped(t0) && isTyped(t1) && (allBoolean(t1) || t1 == universeError))
		recording.go#L108: 			assert(tv.Type != nil) // should have been recorded already
		recording.go#L134: 	assert(ident != nil)
		recording.go#L135: 	assert(typ != nil)
		recording.go#L142: 	assert(id != nil)
		recording.go#L149: 	assert(id != nil)
		recording.go#L150: 	assert(obj != nil)
		recording.go#L157: 	assert(node != nil)
		recording.go#L158: 	assert(obj != nil)
		recording.go#L165: 	assert(obj != nil && (recv == nil || len(index) > 0))
		recording.go#L173: 	assert(node != nil)
		recording.go#L174: 	assert(scope != nil)
		resolver.go#L106: 	assert(ident.Name == obj.Name())
		sizes.go#L55: 		assert(result >= 1)
		sizes.go#L92: 		assert(!isTypeParam(T))
		sizes.go#L170: 		assert(isTyped(T))
		sizes.go#L224: 		assert(!isTypeParam(T))
		sizes.go#L341: 	assert(x >= 0 && 1 <= a && a <= 8 && a&(a-1) == 0)
		stmt.go#L351: 	assert(T != nil)
		stmt.go#L404: 	assert(T != nil)
		stmt.go#L417: 			assert(scope == check.scope)
		stmt.go#L951: 			assert(obj.typ == nil)
		stmt.go#L963: 				assert(i == 0) // at most one iteration variable (rhs[1] == nil or Typ[Invalid] for rangeOverInt)
		stmt.go#L972: 			assert(obj.typ != nil)
		stmt.go#L998: 				assert(i == 0) // at most one iteration variable (rhs[1] == nil or Typ[Invalid] for rangeOverInt)
		stmt.go#L1073: 		assert(typ.Recv() == nil)
		stmt.go#L1089: 		assert(cb.Recv() == nil)
		subst.go#L21: 	assert(len(tpars) == len(targs))
		subst.go#L32: 	assert(len(from) == len(to))
		subst.go#L59: 	assert(expanding != nil || ctxt != nil)
		subst.go#L204: 			assert(t.complete) // otherwise we are copying incomplete data
		typeset.go#L120: 		assert(t.typ != nil)
		typeset.go#L127: 			assert(Identical(u, under(u)))
		typeset.go#L143: 		assert(t.typ != nil)
		typeset.go#L273: 			assert(!isTypeParam(typ))
		typeset.go#L292: 			assert(!tset.comparable)
		typeset.go#L293: 			assert(len(tset.methods) == 0)
		typeset.go#L336: 			assert(t.typ != nil)
		typeset.go#L347: 	assert(!comp || terms.isAll()) // comparable invariant
		typeset.go#L389: 			assert(!isTypeParam(t.typ))
		typestring.go#L86: 	assert(ctxt != nil)
		typestring.go#L362: 	assert(w.ctxt != nil)
		typestring.go#L479: 			assert(w.tparams == nil)
		typexpr.go#L78: 	assert(typ != nil)
		typexpr.go#L107: 		assert(x.val != nil)
		typexpr.go#L194: 	assert(isTyped(typ))
		typexpr.go#L212: 	assert(isTyped(typ))
		typexpr.go#L424: 			assert(t == Typ[Invalid])
		unify.go#L92: 	assert(len(tparams) >= len(targs))
		unify.go#L226: 	assert(hx != nil)
		unify.go#L242: 	assert(t != nil)
		unify.go#L348: 		assert(!isTypeParam(y))
		unify.go#L452: 	assert(x != y && Unalias(x) != Unalias(y))
		unify.go#L660: 		assert(!u.enableInterfaceInference || mode&exact != 0) // handled before this switch
		unify.go#L758: 			assert(u.asBoundTypeParam(x) == nil)
		union.go#L56: 	assert(len(blist) == len(tlist)-1)
		union.go#L172: 	assert(!IsInterface(y.typ))
		universe.go#L293: 	assert(obj.color() == black)
		validtype.go#L129: 				assert(t.obj.pkg == check.pkg)
		validtype.go#L130: 				assert(t.Origin().obj.pkg == check.pkg)